<template>
  <div class="stepContainer">
    <div class="step" v-for="(item, index) in statusList" :key="index">
      <span
        class="el-icon-circle-check stepIcon fontColorTheme"
        v-if="phase > index + 1"
      ></span>
      <span class="stepNum process bgcTheme" v-if="phase === index + 1">{{
        index + 1
      }}</span>
      <span class="stepNum wait" v-if="phase < index + 1">{{ index + 1 }}</span>
      <span
        :class="['stepTitle', phase === index + 1 ? 'deepColor' : 'lightColor']"
        >{{ item }}</span
      >
      <div
        :class="['stepLine', phase >= index + 2 ? 'greenColor bgcTheme' : '']"
        v-show="index < len"
      ></div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'steps',
  props: ['statusList', 'phase'],

  computed: {
    len() {
      return this.statusList.length - 1
    },
  },
}
</script>

<style scoped lang="less">
.stepContainer {
  display: flex;
  -webkit-display: flex;
  justify-content: flex-start;
  align-items: center;
  .step {
    display: flex;
    position: relative;
    -webkit-display: flex;
    justify-content: flex-start;
    align-items: center;
    .stepIcon {
      color: #009588;
      font-size: 35px;
    }
    .stepNum {
      display: inline-block;
      width: 32px;
      height: 32px;
      line-height: 34px;
      text-align: center;
      border-radius: 50%;
    }
    .stepTitle {
      display: inline-block;
      padding-left: 8px;
      font-size: 16px;
      word-break: keep-all;
    }
    .process {
      color: #fff;
      background: #009588;
    }
    .wait {
      color: #999;
      border: 1px solid #999;
    }
    .deepColor {
      color: rgba(0, 0, 0, 0.9);
      font-weight: bold;
    }
    .lightColor {
      color: rgba(0, 0, 0, 0.6);
    }
  }

  .stepLine {
    width: 28px;
    height: 1px;
    background: #999;
    margin: 0 12px;
  }
  .greenColor {
    background: #009588;
  }
}
</style>
